home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Business Master (3rd Edition)
/
The Business Master (3rd Edition).iso
/
files
/
utilstem
/
dosutil2
/
password.bas
< prev
next >
Wrap
BASIC Source File
|
1993-01-01
|
2KB
|
43 lines
1000 '=========================================================================
1010 'PASSWORD.BAS (From "Softalk", March, May & July, 1984)
1015 'minor mods and color added by P. Eskildsen, July 10, 1984
1020 'Uses BASICA 2.0 key trapping to kill Ctrl-Alt-Del, Ctrl-C, & Ctrl-Break:
1030 '
1040 KEY OFF :COLOR 2,0,1
1050 KEY 15,CHR$(12) + CHR$(83) 'CTRL-ALT-DEL
1060 KEY 16,CHR$(4) + CHR$(46) 'CTRL-C
1070 KEY 17,CHR$(4) + CHR$(70) 'CTRL-BREAK
1080 ON KEY(15) GOSUB 1120 : KEY(15) ON
1090 ON KEY(16) GOSUB 1120 : KEY(16) ON
1100 ON KEY(17) GOSUB 1120 : KEY(17) ON
1110 GOTO 1130
1120 BEEP:COLOR 12:PRINT "So there!":COLOR 2:RETURN
1130 '
1140 '
1150 'Read in password
1160 '
1170 OPEN "password.dat" FOR INPUT AS 1
1180 LINE INPUT#1,PASSWORD$
1190 CLOSE
1200 '
1210 'Check user's password entry one char at a time, as entered:
1220 '
1230 WHILE INKEY$ <> "": WEND
1240 CLS: PRINT "Please enter your password:"
1250 TRY = 0
1260 I = 1
1270 A$ = INKEY$:IF A$ = "" THEN 1270
1280 IF A$ = "}" THEN 1330
1290 IF MID$(PASSWORD$,I,1) <> A$ THEN GOTO 1340
1300 IF I = LEN(PASSWORD$) THEN GOTO 1330
1310 I = I + 1:IF I > LEN(PASSWORD$) + 1 THEN GOTO 1340
1320 GOTO 1270
1330 PRINT:LOCATE ,30:COLOR 26:PRINT "Welcome!":COLOR 2,0,1:SYSTEM
1340 'destroy system!
1350 TRY = TRY + 1
1360 COLOR 14:IF TRY < 3 THEN PRINT "Wrong! Try again from start of password.":GOTO 1260
1370 CLS:COLOR 23,4,4:CLS
1375 LOCATE 12,20 :PRINT "- Illegal entry attempt! System killed -"
1380 DEF SEG = 0
1390 FOR I = 0 TO 32767:POKE I,0:NEXT